Q-1: MCQ/Short Question/Fill in the Blanks (Any Five) - Section II (5 Marks)
Questions​
i) What is the full form of API?
ii) What is the use cursor in SQLite?
iii) Which functions are used to delete values from shared preferences?
iv) Define the term animation.
v) Android applications are composed of __________ and __________
vi) Enlist 2 applications in which we can use Google speech API.
vii) What does Google Maps API do in Android?
Answers​
i) Full form of API​
API stands for Application Programming Interface.
It is a set of protocols, routines, and tools for building software applications that specify how software components should interact with each other.
ii) Use of cursor in SQLite​
Cursor in SQLite is used to:
- Navigate through query results: Move through rows returned by a database query
- Data Retrieval: Extract specific column values from result sets
- Row-by-row access: Process query results one row at a time
- Memory efficiency: Handle large datasets without loading all data into memory
- Position tracking: Maintain current position in the result set
Common cursor methods:
moveToFirst()
: Move to first rowmoveToNext()
: Move to next rowgetString(columnIndex)
: Get string value from columngetInt(columnIndex)
: Get integer value from columnclose()
: Close cursor to free resources
iii) Functions to delete values from shared preferences​
The following functions are used to delete values from SharedPreferences:
remove(String key)
: Removes a specific key-value pair
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.remove("keyToDelete");
editor.apply();
clear()
: Removes all key-value pairs from the preferences
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.clear();
editor.apply();
iv) Definition of Animation​
Animation is the process of creating the illusion of motion and change by rapidly displaying a sequence of static images or transforming visual elements over time.
In Android context:
- Visual Effects: Smooth transitions between UI states
- User Experience: Provides feedback and guides user attention
- Property Changes: Gradual modification of view properties (position, size, color, opacity)
- Time-based: Changes occur over a specified duration
- Interpolation: Smooth transitions between start and end values
v) Android applications are composed of​
Android applications are composed of Components and Resources.
Components:
- Activities (UI screens)
- Services (background tasks)
- Broadcast Receivers (system event handlers)
- Content Providers (data management)
Resources:
- Layouts (XML UI definitions)
- Drawables (images, graphics)
- Strings (text resources)
- Styles and themes
- Configuration files
vi) Applications using Google Speech API​
Two applications where Google Speech API can be used:
-
Voice Assistant Apps
- Virtual assistants like Google Assistant
- Smart home control applications
- Voice-controlled navigation apps
-
Transcription and Note-taking Apps
- Voice-to-text note-taking applications
- Meeting transcription software
- Language learning apps with pronunciation features
Additional examples:
- Voice search applications
- Accessibility apps for visually impaired users
- Hands-free messaging applications
vii) Google Maps API functions in Android​
Google Maps API provides the following functionality in Android:
-
Map Display:
- Show interactive maps with different views (normal, satellite, terrain)
- Zoom and pan functionality
-
Location Services:
- Display current user location
- Geocoding (convert addresses to coordinates)
- Reverse geocoding (convert coordinates to addresses)
-
Markers and Overlays:
- Add custom markers and info windows
- Draw polylines, polygons, and circles
- Custom map styling
-
Navigation Features:
- Route calculation and directions
- Turn-by-turn navigation
- Traffic information
-
Places Integration:
- Search for nearby places
- Place details and photos
- Autocomplete for place names
-
Geofencing:
- Create virtual boundaries
- Trigger events when entering/exiting areas
Common use cases:
- Location-based apps
- Delivery and logistics applications
- Travel and tourism apps
- Real estate applications